<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>日语-- けんさ </h2>
    <button  onclick="playAudio()"  >发音</button>
    <audio id='audioPlay' src='http://dict.youdao.com/dictvoice?le=jap&audio=けんさ&type=3' />
    <script>
        function playAudio(){
                        //得到读音名字
                        var word='けんさ'
                        console.log(word);
                        //改变读音地址
                        document.getElementById('audioPlay').src='http://dict.youdao.com/dictvoice?le=jap&type=3&audio='+word;
                        document.getElementById('audioPlay').play();
                    }
    </script>
</body>
</html>